<template>
  <div id="deliverPoster"></div>
</template>
<script>
export default {
  data() {
    return {};
  },
  methods: {
    getData() {
      $http
        .post("plugin.package-deliver.frontend.deliver-share.index", { deliver_id: this.$route.params.id }, "")
        .then(response => {
          if (response.result === 1) {
            if (response.data.web_share_url) {
              window.location.href = response.data.web_share_url;
            } else {
              this.$router.push(this.fun.getUrl("home"));
            }
          } else {
            this.$dialog.alert({ message: response.msg });
          }
        })
        .catch(error => {
          console.log(error);
        });
    }
  },
  activated() {
    this.getData();
  }
};
</script>
<style lang="scss" scoped>
</style>